import math
class Solution(object):
    def minimumTime(self, time, totalTrips):
        left = 1
        right = totalTrips * min(time)
        def cal(val):
            ans = 0
            for t in time:
                ans += val // t
            return ans >= totalTrips
        while left < right:
            mid = (left + right) // 2
            if cal(mid):
                right = mid
            else:
                left = mid + 1
        return left
